using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System;

using MySpring;

namespace SolutionOrchestrator
{

	public class SolutionSettings : ObservableObject
	{
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
		public string Path { get; set; }


		protected override void OnPropertyChanged(string name)
		{
			Save();
			base.OnPropertyChanged(name);
		}

		public void Save()
		{
			if (!string.IsNullOrEmpty(Path))
			{
				File.WriteAllText(Path, XamlHelper.Save(this));
			}
		}
	}
}